cmake_minimum_required(VERSION 3.12)
project(Components LANGUAGES CXX)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

# 添加子目录
add_subdirectory(src/core)
add_subdirectory(src/auth)
add_subdirectory(src/cache)
add_subdirectory(src/config)
add_subdirectory(db)

# 测试选项
option(BUILD_TESTS "Build tests" ON)
if(BUILD_TESTS)
    enable_testing()
    add_subdirectory(test/core)
    add_subdirectory(test/auth)
    add_subdirectory(test/cache)
    add_subdirectory(test/config)
endif()

# 安装规则
install(DIRECTORY include/ DESTINATION include)